﻿
using Xacml.Core.Interfaces;
using System.Collections;

namespace Xacml.Core.Policy
{
  public class IExpressionCollectionReadWrite : CollectionBase
  {
    public virtual int Add(IExpression value)
    {
      return this.List.Add((object) value);
    }

    public new virtual void Clear()
    {
      base.Clear();
    }

    public new virtual void RemoveAt(int index)
    {
      base.RemoveAt(index);
    }

    public int GetIndex(IExpression expression)
    {
      for (int index = 0; index < this.Count; ++index)
      {
        if (this.List[index] == expression)
          return index;
      }
      return -1;
    }
  }
}
